Part Number Hot Search : 
B4223 1N5639AB LA1137 29LV1 LC66556B MM3Z39VC 1N5639AB PSP480S
Product Description
Full Text Search
 

To Download AN1603 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  AN1603/0203 1/21 AN1603 application note using the st7 usb device firmware upgrade development kit (dfu-dk) by microcontroller division applications 1 introduction this application note describes how to use the st7 usb dfu pc development kit (dfu-dk). it begins with a presentation of the software architecture. it then gives a full description of the dfu-dk programming interface and all the features. finally, an example is given of a vendor upgrade package developed with the dfu-dk. the objective of the dfu-dk is to provide you with a simple means of upgrading the firmware of a usb device. it runs under microsoft windows and works with any stmicroelectronics usb microcontroller that supports the dfu capability including the st72f62, st72f63 and st72f65x mcu families. the dfu-dk can be downloaded from sts website. related documentation: st7 usb device firmware upgrade demonstrator user manual. 1
2/21 using the st7 usb device firmware upgrade development kit (dfu-dk) 1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 list of installed files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.1 development modules for building your own pc software . . 3 2.2 documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.3 dfu driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.4 example vendor upgrade software files . . . . . . . . . . . . . . . . . . . . 3 3 software architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4 dfu-dk programming interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 4.1 overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 4.2 driver installation file (.inf) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 4.3 programming interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4.3.1 stdfu_enumgetnbdevices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4.3.2 stdfu_getdevicedescriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4.3.3 stdfu_getdfudescriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 4.3.4 stdfu_getstringdescriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4.3.5 stdfu_getnbofconfigurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4.3.6 stdfu_getconfigurationdescriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.3.7 stdfu_getnbofinterfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.3.8 stdfu_getnbofalternates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.3.9 stdfu_getinterfacedescriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.3.10stdfu_open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.3.11stdfu_close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.3.12stdfu_detach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.3.13stdfu_dnload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.3.14stdfu_upload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.3.15stdfu_getstatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4.3.16stdfu_clrstatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.3.17stdfu_getstate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.3.18stdfu_abort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.3.19stdfu_handledevicechange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 5 example vendor upgrade software (dfu demonstrator) . . . . . . . . 17 5.1 st7dfuprt programming interface . . . . . . . . . . . . . . . . . . . . . . . . . . 17 5.1.1 overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 5.1.2 programming interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 5.2 dfu demonstrator gui . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2
3/21 using the st7 usb device firmware upgrade development kit (dfu-dk) 2 list of installed files this section provides a list of all the dfu-dk files referred to in this application note. 2.1 development modules for building your own pc software in the dev subdirectory, you will find the following items : C bin subdirectory -st7dfu.dll : interface dll -sttubedevice203.dll : driver dll used by the st7dfu dll C inc subdirectory -st7dfu.h : c header containining all prototypes exported by st7dfu.dll -usb100.h : microsoft header for usb. C lib subdirectory -st7dfu.lib : static lib file 2.2 documentation in the doc subdirectory, you will find the following items : C application note AN1603: this file. 2.3 dfu driver in the driver subdirectory, you will find the following items : C stdfu.inf: installation file for the dfu driver that can be customised to meet the require- ments of your application C sttub203.sys: stmicroelectronics tube driver used as a dfu class driver 2.4 example vendor upgrade software files in the sources subdirectory, you will find the following items : C binary subdirectory inludes binary modules: debug and release C dfudemo subdirectory includes gui sources C st7dfuprt subdirectory includes dfu protocol dll sources
4/21 using the st7 usb device firmware upgrade development kit (dfu-dk) 3 software architecture figure 1. dfu-dk software layers usb bus interface st7dfu.dll dfu gui microsoft usb driver stack ( usbd ) sttubxxx.sys sttubedevice xxx.dll st7dfuprt.dll user mode kernel mode hardware stmicroelectronics binary module firmware image & suffix image.s19 ima g e.dfu tube-driver for the dfu class protocol dfu interface stmicroelectronics reference software status and error reporting dfu interface protocol
5/21 using the st7 usb device firmware upgrade development kit (dfu-dk) as shown in figure 1, we can see that the dfu software is divided into four distinct layers: C the hardware layer (usb bus interface), C the kernel layer (microsoft usb stack and stmicroelectronics tube driver) and a user application layer that is also divided into two other layers: C a generic one that manages all dfu requests and is provided as ready binary modules (st7dfu and sttubedevice203 dynamic link libraries). C a vendor-specific one that is provided as an example reference software (protocol manage- ment dynamic link library and a demonstration gui). this modular architecture was chosen so that the dfu-dk can be used for any application that needs to implement dfu features. moreover, this will make it easier to add features any- time in the future and manage changes. note: the dfu-dk is compatible with windows 98, 98se, me, 2000 and xp and is compliant with the device class specification for dfu version1.0 as detailed by the usb-if.
6/21 using the st7 usb device firmware upgrade development kit (dfu-dk) 4 dfu-dk programming interface 4.1 overview this module is used to allow the application to access the low level usb protocol, such as re- ceiving descriptor information, configuring a device etc, and also for managing all dfu re- quests that are implemented in this module and are not linked to the application layer. the following table summarize the dfu class-specific requests used to accomplish the up- grade operation. 4.2 driver installation file (.inf) before creating or customising the dfu inf file, you have to obtain two licence keys for your vendor id and product ids, in order to use the dfu driver : one for the product id of your com- posite device (functional mode + dfu mode) and one for the only dfu mode device. in our example we have two distinct keys, one for the pid=0xdf11 (stmicroelectronics dfu devices) which is 6f72a98be4e1edad and another one for a composite device, pid= 0xff03 (stmicroelectronics evalkit and dfu) which is d083fc290a34aa18. once you have your licence keys, you need to make your own inf file. the inf file is a text file used by windows to install a driver. the one given in this package can be customised to fit your needs. anyway, you have to choose your own name for the inf file, and you shouldnt use the one given in the package. after a successful driver installation the correct values in this inf file will be entered in the reg- istery. table 1. dfu class specific requests bmrequettype brequest wvalue windex wlength data 00100001b dfu_detach wtimeout interface zero none 00100001b dfu_dnload wblocknum interface length firmware 10100001b dfu_upload wblocknum interface length firmware 10100001b dfu_getstatus zero interface 6 status 00100001b dfu_clrstatus zero interface zero none 10100001b dfu_getstate zero interface 1 state 00100001b dfu_abort zero interface zero none
7/21 using the st7 usb device firmware upgrade development kit (dfu-dk) 4.3 programming interface this is the application-programming interface of the st7dfu.dll module. the documentation describes the interface in c language. 4.3.1 stdfu_enumgetnbdevices 4.3.1.1 prototype dword stdfu_enumgetnbdevices( pdword pnb, hwnd hwnd, dword message); 4.3.1.2 description browses all dfu devices connected to the pc. 4.3.1.3 parameters pnb: pointer to the number of dfu devices hwnd :window handle message: notifies an application of a change to the hardware configuration of a dfu-device. 4.3.1.4 returned value stdfu_noerror in case of success, otherwise (error code) 4.3.1.5 remarks for more details about hwnd and message parameters please refer to section 4.3.19 the following section provides all error codes that can be returned by any function: stdfu_error_offset 0x12340000 stdfu_noerror stdfu_error_offset stdfu_memory (stdfu_error_offset+1) stdfu_badparameter (stdfu_error_offset+2) stdfu_notimplemented (stdfu_error_offset+3) stdfu_enumfinished (stdfu_error_offset+4) stdfu_opendrivererror (stdfu_error_offset+5) stdfu_errordescriptorbuilding (stdfu_error_offset+6) stdfu_pipecreationerror (stdfu_error_offset+7) stdfu_pipereseterror (stdfu_error_offset+8) stdfu_pipeaborterror (stdfu_error_offset+9) stdfu_stringdescriptorerror (stdfu_error_offset+0xa) stdfu_driverisclosed (stdfu_error_offset+0xb) stdfu_vendor_rq_pb (stdfu_error_offset+0xc) stdfu_errorwhilereading (stdfu_error_offset+0xd) stdfu_errorbeforereading (stdfu_error_offset+0xe) stdfu_errorwhilewriting (stdfu_error_offset+0xf)
8/21 using the st7 usb device firmware upgrade development kit (dfu-dk) stdfu_errorbeforewriting (stdfu_error_offset+0x10) stdfu_devicereseterror (stdfu_error_offset+0x11) stdfu_cantuseunplugevent (stdfu_error_offset+0x12) stdfu_incorrectbuffersize (stdfu_error_offset+0x13) stdfu_descriptornotfound (stdfu_error_offset+0x14) stdfu_pipesareclosed (stdfu_error_offset+0x15) stdfu_pipesareopen (stdfu_error_offset+0x16) stdfu_timeoutwaitingforreset (stdfu_error_offset+0x17) 4.3.2 stdfu_getdevicedescriptor 4.3.2.1 prototype dword stdfu_getdevicedescriptor(dword num, pusb_device_descriptor pdesc); 4.3.2.2 description gets the dfu-device descriptor 4.3.2.3 parameters num: number of the selected dfu device (given by stdfu_enumgetnbdevices) pdesc: buffer the descriptor will be copied to. 4.3.2.4 returned value stdfu_noerror in case of success, otherwise (error code) 4.3.3 stdfu_getdfudescriptor 4.3.3.1 prototype typedef struct _dfu_functional_descriptor { uchar blength; uchar bdescriptortype; uchar bmattributes; ushort wdetachtimeout; ushort wtransfertsize; } dfu_functional_descriptor, *pdfu_functional_descriptor; dword stdfu_getdfudescriptor( dword num, pdfu_functional_descriptor pdesc, puint pnbofdfuinterface); 4.3.3.2 description gets the dfu descriptor
9/21 using the st7 usb device firmware upgrade development kit (dfu-dk) 4.3.3.3 parameters num: number of the selected dfu device (given by stdfu_enumgetnbdevices) pdesc: buffer the dfu descriptor will be copied to. pnbofdfuinterface: pointer to the dfu interface number 4.3.3.4 returned value stdfu_noerror in case of success, otherwise (error code) 4.3.4 stdfu_getstringdescriptor 4.3.4.1 prototype dword stdfu_getstringdescriptor(dword num, dword index, lpstr szstring, uint nstringlength); 4.3.4.2 description gets the string descriptor 4.3.4.3 parameters num: number of the selected dfu device (given by stdfu_enumgetnbdevices) nindex: desired string descriptor index. if this index is too high, this function will return an error. szstring: buffer the string descriptor will be copied to nstringlength: buffer size 4.3.4.4 returned value stdfu_noerror in case of success, otherwise (error code). 4.3.5 stdfu_getnbofconfigurations 4.3.5.1 prototype dword stdfu_getnbofconfigurations( dword num, puint pnbofconfigs); 4.3.5.2 description gets configurations number 4.3.5.3 parameters num: number of the selected dfu device (given by stdfu_enumgetnbdevices)
10/21 using the st7 usb device firmware upgrade development kit (dfu-dk) pnbofconfigs: pointer to the number of configurations 4.3.5.4 returned value stdfu_noerror in case of success, otherwise (error code). 4.3.6 stdfu_getconfigurationdescriptor 4.3.6.1 prototype dword stdfu_getconfigurationdescriptor( dword num, uint nconfigidx, pusb_configuration_descriptor pdesc); 4.3.6.2 description gets the configuration descriptor 4.3.6.3 parameters num: number of the selected dfu device (given by stdfu_enumgetnbdevices) nconfigidx: number of the selected configuration pdesc: buffer the descriptor will be copied to. 4.3.6.4 returned value stdfu_noerror in case of success, otherwise (error code). 4.3.7 stdfu_getnbofinterfaces 4.3.7.1 prototype dword stdfu_getnbofinterfaces( dword num, uint nconfigidx, puint pnbofinterfaces); 4.3.7.2 description gets the number of interfaces 4.3.7.3 parameters num: number of the selected dfu device (given by stdfu_enumgetnbdevices) nconfigidx : number of the selected configuration pnbofinterfaces: pointer to number of interfaces 4.3.7.4 returned value stdfu_noerror in case of success, otherwise (error code).
11/21 using the st7 usb device firmware upgrade development kit (dfu-dk) 4.3.8 stdfu_getnbofalternates 4.3.8.1 prototype dword stdfu_getnbofalternates( dword num, uint nconfigidx, uint ninterfaceidx, puint pnbofaltsets); 4.3.8.2 description gets alternate settings number. 4.3.8.3 parameters num: number of the selected dfu device (given by stdfu_enumgetnbdevices) nconfigidx: number of the selected configuration ninterfaceidx : number of the selected interface pnbofaltsets: pointer to alternate settings number 4.3.8.4 returned value stdfu_noerror in case of success, otherwise (error code). 4.3.9 stdfu_getinterfacedescriptor 4.3.9.1 prototype dword stdfu_getinterfacedescriptor( dword num, uint nconfigidx, uint ninterfaceidx, uint naltsetidx, pusb_interface_descriptor pdesc); 4.3.9.2 description gets the interface descriptor. 4.3.9.3 parameters num: number of the selected dfu device (given by stdfu_enumgetnbdevices) nconfigidx: number of the selected configuration ninterfaceidx: number of the selected interface naltsetidx: number of the selected alternate setting pdesc: buffer the descriptor will be copied to. 4.3.9.4 returned value stdfu_noerror in case of success, otherwise (error code).
12/21 using the st7 usb device firmware upgrade development kit (dfu-dk) 4.3.10 stdfu_open 4.3.10.1 prototype dword stdfu_open ( dword num, phandle phdevice); 4.3.10.2 description opens the dfu driver, giving access to its descriptors. 4.3.10.3 parameters num: number of the selected dfu device (given by stdfu_enumgetnbdevices). phdevice: handle returned by the function when the driver is successfully opened 4.3.10.4 returned value stdfu_noerror in case of success, otherwise (error code). 4.3.11 stdfu_close 4.3.11.1 prototype dword stdfu_close(phandle phdevice); 4.3.11.2 description closes the dfu driver. 4.3.11.3 parameters phdevice: pointer to handle returned by the stdfu_open function 4.3.11.4 returned value stdfu_noerror in case of success, otherwise (error code). 4.3.12 stdfu_detach 4.3.12.1 prototype dword stdfu_detach ( phandle phdevice, ushort wtimeout, uchar dfuinterfacenumber); 4.3.12.2 description issues a detach request to the control pipe (endpoint0). 4.3.12.3 parameters phdevice: pointer to handle returned by the stdfu_open function
13/21 using the st7 usb device firmware upgrade development kit (dfu-dk) wtimeout: detach timeout value dfuinterfacenumber: dfu interface number given by stdfu_getdfudescriptor 4.3.12.4 returned value stdfu_noerror in case of success, otherwise (error code). 4.3.12.5 remarks this function sends a detach then it waits for a reset from the device in order to be in a dfu mode, if 15 seconds elapse with no device change, it will return a stdfu_timeoutwaitingforreset error. 4.3.13 stdfu_dnload 4.3.13.1 prototype dword stdfu_dnload( phandle phdevice, uchar *pbuffer, ulong nbytes, ushort nblock); 4.3.13.2 description issues a download request to the control pipe (endpoint0). 4.3.13.3 parameters phdevice: pointer to handle returned by the stdfu_open function buffer: buffer of data nbytes: number of data bytes to be downloaded nblock: number of data blocks to be downloaded 4.3.13.4 returned value stdfu_noerror in case of success, otherwise (error code). 4.3.14 stdfu_upload 4.3.14.1 prototype dword stdfu_upload ( phandle phdevice, uchar *pbuffer, ulong nbytes, ushort nblock); 4.3.14.2 description issues an upload request to the control pipe (endpoint0).
14/21 using the st7 usb device firmware upgrade development kit (dfu-dk) 4.3.14.3 parameters phdevice: pointer to handle returned by the stdfu_open function buffer: buffer of data nbytes: number of data bytes to be uploaded nblock: number of data blocks to be uploaded 4.3.14.4 returned value stdfu_noerror in case of success, otherwise (error code). 4.3.15 stdfu_getstatus 4.3.15.1 prototype typedef struct { uchar bstatus; uchar bwpolltimeout[3]; uchar bstate; uchar istring; }dfustatus, *pdfustatus; dword stdfu_getstatus (phandle phdevice, dfustatus *dfustatus); 4.3.15.2 description issues a getstatus request to the control pipe (endpoint0). 4.3.15.3 parameters phdevice: pointer to handle returned by the stdfu_open function dfustatus: structure containing dfu status structure 4.3.15.4 returned value stdfu_noerror in case of success, otherwise (error code). 4.3.15.5 remarks this function sends a getstatus request and it tests if the device is on a state equal to state_dfu_manifest_wait_reset or state_dfu_manifest then it closes the driver and it waits for a reset from the device in order to return to application mode, if 15 sec- onds elapse with no device change, it will return a stdfu_timeoutwaitingforreset error.
15/21 using the st7 usb device firmware upgrade development kit (dfu-dk) 4.3.16 stdfu_clrstatus 4.3.16.1 prototype dword stdfu_clrstatus (phandle phdevice); 4.3.16.2 description issues a clearstatus request to the control pipe (endpoint0). 4.3.16.3 parameters phdevice: pointer to handle returned by the stdfu_open function 4.3.16.4 returned value stdfu_noerror in case of success, otherwise (error code). 4.3.17 stdfu_getstate 4.3.17.1 prototype dword stdfu_getstate (phandle phdevice, uchar *pstate); 4.3.17.2 description issues a getstate request to the control pipe (endpoint0). 4.3.17.3 parameters phdevice: pointer to handle returned by the stdfu_open function pstate: pointer to a dfu state 4.3.17.4 returned value stdfu_noerror in case of success, otherwise (error code). 4.3.18 stdfu_abort 4.3.18.1 prototype dword stdfu_abort (phandle phdevice); 4.3.18.2 description issues an abort request to the control pipe (endpoint0). 4.3.18.3 parameters phdevice: pointer to handle returned by the stdfu_open function. 4.3.18.4 returned value stdfu_noerror in case of success, otherwise (error code).
16/21 using the st7 usb device firmware upgrade development kit (dfu-dk) 4.3.19 stdfu_handledevicechange 4.3.19.1 prototype bool stdfu_handledevicechange (wparam wparam, lparam lparam); 4.3.19.2 description this function must be called by the application when receiving a wm_devicechange. 4.3.19.3 parameters wparam: device-change event that could be for example a dbt_devicearrival or a bt_deviceremovecomplete event etc. lparam: event-specific data. 4.3.19.4 returned value stdfu_noerror in case of success, otherwise (error code). 4.3.19.5 remarks in any application or gui working with a driver and thus with a device, you first have to identify and specify the device or the type of the device that you are dealing with and for which a window will receive notifications. once this has been done, the wm_devicechange device message will notify the applica- tion of a change to the hardware configuration of a device. note: for more details about this mechanism, please refer to microsoft msdn help, you can also refer to the source files of the dfu demonstrator to see an example of implementation.
17/21 using the st7 usb device firmware upgrade development kit (dfu-dk) 5 example vendor upgrade software (dfu demonstrator) this section describes the dfu demonstrator software, as previously mentioned, this applica- tion is divided into two distinct modules: a protocol dynamic link library and a graphical user in- terface. 5.1 st7dfuprt programming interface 5.1.1 overview this dll is in charge of the protocol layer management between the firmware image (stored on local disk) and data sent/received to/from the st7 usb device through the st7dfu.dll ge- neric module by means of dfu requests to the control pipe (endpoint0). the main features of this dll are the following : C reading & decoding the new firmware image (processing the suffix and useful binary data ). C writing & coding the old firmware image. C performing the firmware upgrade operations by responding to all dfu interface states and the transitions between them. C sending to upper layers status, errors, warning messages and progress. the firmware image will encapsulate the following information : target addresses, data record sizes, useful data and a suffix. the purpose of the dfu suffix is to allow the host software to detect and prevent attempts to download incompatible firmware. for more details about the dfu file suffix and how to compute the crc please refer to device class specification for dfu version 1.0 , appendix b. note: due to the fact that all functions exported by this dll take a longer time than other mod- ules, its structure will be based on (mainly asynchronous) processes and threaded code. 5.1.2 programming interface this is the application programming interface of the stdfuprt.dll module. the documenta- tion describes the interface in c language . 5.1.2.1 st_imagefromdfufile prototype dword winapi st_imagefromdfufile( char * ppathfile, uchar * pbuffer, uint * pvid, uint * ppid, uint * pbcd ); description
18/21 using the st7 usb device firmware upgrade development kit (dfu-dk) reads and decodes the file image stored in disk and stores all its binary data contents to a buffer in ram and extracts useful device information (vendor id, product id, and firmware version) parameters ppathfile : the entry path name of the firmware image stored on disk. pbuffer : a pointer to a data buffer where the useful data will be stored in ram. pvid: a pointer to the vendor id parameter. ppid: a pointer to the productid parameter. pbcd:a pointer to the firmware version parameter. returned value stdfu_noerror in case of success, otherwise (error code). 5.1.2.2 st_imagetodfufile prototype dword winapi st_imagetodfufile( char * ppathfile, uchar * pbuffer, uint nvid, uint npid, uint nbcd ); description writes and codes data stored in ram buffer and received from the device during the up- loading process to a valid firmware image on local disk. parameters ppathfile : the entry path name of the firmware image where the file will be stored on disk. pbuffer : a pointer to a data buffer received from the device. nvid : device vendor id. npid : device product id. nbcd: old firmware version. returned value stdfu_noerror in case of success, otherwise (error code).
19/21 using the st7 usb device firmware upgrade development kit (dfu-dk) 5.1.2.3 st_devicefirmwareupgrade prototype dword winapi st_devicefirmwareupgrade(dword nb, uchar * pbufferin, uchar * pbufferout); description this is the main dfu protocol function, you can use it and/or develop your own solution and it is only intended as an example. its functional goal is to start all the previous dfu request func- tions and process the device upgrade automatically. parameters nb :number of the selected dfu device (given by stdfu_enumgetnbdevices) pbufferin : pointer to a 64kbyte ram buffer where the new firmware image is stored. pbufferout :pointer to a 64kbyte ram buffer where the oldfirmware image will be stored. returned value stdfu_noerror in case of success, otherwise (error code). 5.1.2.4 st_getdfustatus prototype dword winapi st_getdfustatus( pdword ppercent, pdword pstage, pdword perror); description returns dfu status and errors data to the application gui. parameters ppercent: stage process completion percentage. pstage:dfu process stage such as detach, upload, upgrade etc. perror: dfu error. returned value stdfu_noerror in case of success, otherwise (error code).
20/21 using the st7 usb device firmware upgrade development kit (dfu-dk) 5.2 dfu demonstrator gui the graphical user interface in this package is provided as a demonstrator and accesses the lower layers of the dfu software( st7dfuprt.dll and st7dfu.dll) to get information related to the usb device, to initiate dfu operations (upgrade with or without upload) and also to dis- play errors, warnings, debug messages and progress . a simple gui is provided to demonstrate the dfu utility. its main features are the following: C select one available usb device and display its properties (ex: vid, pid, rev), C choose to upgrade the device and to store its present firmware version, C select from the pc browser the new firmware image and the file to be stored, C integrate a dfu file generator, C start button to start operations, C abort button to cancel a programming or read operation. C progress tool bar, C display all debugging messages (error messages etc.), C gui exit, gui help. note: the dfu demonstrator gui is written in c++, using mfc in microsoft visual c++ 6.0. all source code, including a project file is included with the dfu-dk package.
21/21 using the st7 usb device firmware upgrade development kit (dfu-dk) the present note which is for guidance only aims at providing customers with information regarding their products in order for them to save time. as a re- sult, stmicroelectronics shall not be held liable for any direct, indirect or consequential damages with respect to any claims arising from the content of such a note and/or the use made by customers of the information contained herein in connection with their products. information furnished is believed to be accurate and reliable. however, stmicroelectronics assumes no responsibility for the co nsequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. no license is granted by implication or otherwise under any patent or patent rights of stmicroelectronics. specifications mentioned in this publicati on are subject to change without notice. this publication supersedes and replaces all information previously supplied. stmicroelectronics prod ucts are not authorized for use as critical components in life support devices or systems without the express written approval of stmicroele ctronics. the st logo is a registered trademark of stmicroelectronics ? 2003 stmicroelectronics - all rights reserved. purchase of i 2 c components by stmicroelectronics conveys a license under the philips i 2 c patent. rights to use these components in an i 2 c system is granted provided that the system conforms to the i 2 c standard specification as defined by philips. stmicroelectronics group of companies australia - brazil - canada - china - finland - france - germany - hong kong - india - israel - italy - japan malaysia - malta - morocco - singapore - spain - sweden - switzerland - taiwan - thailand -tunisia- united kingdom - u.s.a. http://www.st.com


▲Up To Search▲   

 
Price & Availability of AN1603

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X